package VendingMachine;
import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;



public class VendingMachineItemTest {
	VendingMachineItem item1;
	VendingMachineItem item2;

	@Before
	public void setUp() throws Exception {
		item1 = new VendingMachineItem("Apple",2.00);
	}
	
	@Test
	public void getNameTest()
	{
		//test assert name to item
		assertEquals("Apple", item1.getName());
		
	}
	
	@Test
	public void getPriceTest()
	{
		//test assert price to item
		assertEquals(2.00, item1.getPrice(),2.00);
	}
	
	@Test
    public void testLessThanZero()

    {
	try{	
          item2 = new VendingMachineItem("Apple", -2.00);
    }catch (VendingMachineException e){

    }
   
}}
